home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
system
/
csh4.zip
/
BACKUP.C
< prev
next >
Wrap
C/C++ Source or Header
|
1985-09-03
|
476b
|
27 lines
#include <stdio.h>
char buf[256];
char buf2[256];
main()
{
char *gets(),*rindex();
char *patch;
while(gets(buf))
{
patch = rindex(buf,'\\');
*(++patch) = '\0';
sprintf(buf2,"d:%s",buf);
*rindex(buf2,'\\') = '\0';
if (-1 == mkdir(buf2))
{
fprintf(stderr,"cant make %s\n",buf2);
continue;
}
sprintf(buf2,"cp %s*.* d:%s",buf,buf);
fprintf(stderr,buf2);
write(2,"\r\n",2);
*rindex(buf2,'\\') = '\0';
system(buf2);
}
}